<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>HUI 轮播组件</title>
<link rel="stylesheet" type="text/css" href="../css/hui.css" />
</head>
<body>
<header class="hui-header">
    <div id="hui-back"></div>
    <h1>HUI 轮播组件</h1>
</header>
<div class="hui-wrap">
	<div class="hui-common-title" style="margin-top:15px;">
		<div class="hui-common-title-line"></div>
		<div class="hui-common-title-txt">轮播组件演示</div>
		<div class="hui-common-title-line"></div>
	</div>
	<div style="padding:10px;">
	    <div class="hui-swipe" id="swipe">
	    	<div class="hui-swipe-items">
	            <div class="hui-swipe-item"><img src="../img/swipe/1.jpg"/></div>
	            <div class="hui-swipe-item"><img src="../img/swipe/2.jpg"/></div>
	            <div class="hui-swipe-item"><img src="../img/swipe/3.jpg"/></div>
	            <div class="hui-swipe-item"><img src="../img/swipe/4.jpg"/></div>
	        </div>
	    </div>
	</div>
    <div class="hui-common-title" style="margin-top:15px;">
		<div class="hui-common-title-line"></div>
		<div class="hui-common-title-txt">远程图片获取</div>
		<div class="hui-common-title-line"></div>
	</div>
	<div style="padding:10px; width:260px;">
	    <div class="hui-swipe" id="swipe2">
	    	<div class="hui-swipe-items"></div>
	    </div>
	</div>
</div>
<script src="../js/hui.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/hui-swipe.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var swipe = new huiSwpie('#swipe');
swipe.autoPlay = false;
swipe.run();
//加载远程图片示例
hui.get(
    'http://hoa.hcoder.net/index.php?user=hcoder&pwd=hcoder&m=lunbo',
    function(res){
        var arr  = res.split('--hcSplitor--');
        for(var i = 0; i < arr.length; i++){
            var div = document.createElement('div')
            div.setAttribute('class', 'hui-swipe-item');
            div.innerHTML = arr[i];
            hui(div).appendTo('#swipe2 .hui-swipe-items');
        }
        var swipe2 = new huiSwpie('#swipe2');
        swipe2.run();
    },
    function(){
        hui.toast('读取远程数据失败');
    }
);
</script>
</body>
</html>